import { requestCategoryList } from "@/api";

/* vuex的home模块配置 */
const state = {
  categoryList:[],
};
const mutations = {
     //设置categoryList值的mutations方法
    //   SET_CATEGORYLIST_STATE官方大写设置state
     SET_CATEGORYLIST_STATE(state,value){
       state.categoryList=value
     }
};
//从vuex获取数据
const actions = {
    async getCategoryList({commit}){
        const result = await requestCategoryList();
        commit("SET_CATEGORYLIST_STATE", result)
    }
};
const  getters={};
export default {
    namespaced: true,
    state,
    mutations,
    actions,
    getters,
  };
  